import { BrowserRouter as Router, Route, Switch, Redirect } from 'react-router-dom';

import { Home } from './Pages/Home';
import { Goods } from './Pages/Goods';
import { Detail } from './Pages/Detail';
import { ShoppingCar } from './Pages/ShoppingCar';
import { Register } from './Pages/Register';
import { Login } from './Pages/Login';

export class Index extends React.Component {
    constructor() {
        super();
    }
    render() {
        return (
            <div>

                <Switch>
                    <Redirect path="/" to="/home" exact={true} />
                    <Route path="/home" exact={true} component={Home} />
                    <Route path="/goods" exact={true} component={Goods} />
                    <Route path="/detail/:goodsID" exact={true} component={Detail} />
                    <Route path="/shoppingcar" exact={true} component={ShoppingCar} />
                    <Route path="/register" exact={true} component={Register} />
                    <Route path="/login" exact={true} component={Login} />
                </Switch>
            </div>
        );
    }
}